<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="recordId" value="#{assessRecordHome.id}"></f:viewParam>
	   	<f:viewParam name="taskId" value="#{bpmHome.taskId}"></f:viewParam>
   	</f:metadata>
   	
    <ui:define name="head">
   		<style type="text/css">
	   		.column{
	   			width: 30%;
	   		}
	   		.value{
	   			width: 70%;
	   		}   		
   		</style>
    </ui:define>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="信用评价审核" style="margin-bottom:10px;">
		        <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        <h:panelGrid columns="2" cellpadding="5">		        			
					<p:outputLabel  value="中介机构" />	
					<h:outputText value="#{assessRecordHome.instance.serviceSupplier.cnname}" />
       			  			
					<p:outputLabel  value="评价事项" />
					<h:outputText value="#{assessRecordHome.instance.dict.title}" />
       			    			
					<p:outputLabel  value="分值" rendered="#{ not empty assessRecordHome.instance.score }" />
					<h:outputText value="#{assessRecordHome.instance.dict.calcMethod.operator}#{assessRecordHome.instance.score}" rendered="#{ not empty assessRecordHome.instance.score }" />
       			        			
					<p:outputLabel  value="评价时间" />
					<h:outputText  value="#{assessRecordHome.instance.assessDate}"  >
						<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss "/>
					</h:outputText>
       			        			
					<p:outputLabel  value="评价结果" />
					<h:outputText value="#{assessRecordHome.instance.assessResult}" />
       			        			
					<p:outputLabel  value="图片材料" />
					<p:outputPanel>
						<p:repeat var="_image" value="#{assessRecordHome.instance.images}" varStatus="_status">
							<div id="imgsPreview_#{_image.id}" >		       				
		       					<img  data-original="#{attachmentUtils.getFullPath(_image)}" src="#{attachmentUtils.getFullPath(_image)}"  width="240"/>		       				
		       				</div>
	       				</p:repeat>
					</p:outputPanel>
	       		
	       			<p:outputLabel value="附件材料" />
	       			<c:set var="attachmentCount" value="#{assessRecordService.getAttachmentCountById(assessRecordHome.instance.id)}" />
	       			<c:if test="#{attachmentCount > 0}">
	       				<a href="#{request.contextPath}/rest/assessRecords/archive/#{assessRecordHome.instance.id}" >下载</a>
	       			</c:if>
	       			<c:if test="#{attachmentCount eq 0}">
	       				<h:outputText value="暂无附件" />
	       			</c:if>
	       			
	       			<p:outputLabel value="得分"></p:outputLabel>
					<h:outputText
						value="#{assessRecordHome.instance.score}分" />
				</h:panelGrid>
			</p:panel>
			
			<p:button outcome="FinishedTaskList.xhtml" value="取消" >
				<f:param name="processKey" value="#{bpmHome.task.processDefinitionId.substring(0, bpmHome.task.processDefinitionId.indexOf(':'))}"></f:param>
			</p:button>
		</h:form>		
		
   	</ui:define>
</ui:composition>
